package com.itheima.mapper;

import com.itheima.dto.StudentDto;
import com.itheima.pojo.Student;
import com.itheima.vo.StudentVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface StudentMapper {
    List<StudentVo> pageQuery(StudentDto student);

    @Select("select count(1) from student")
    Integer countQuery(StudentDto student);

    void insert(Student student);

    @Select("select * from student where id=#{id}")
    Student selectById(Integer id);

    void update(Student student);

    @Delete("delete from student where id=#{id}")
    void deleteById(Integer id);

    @Select("select distinct degree from student")
    List<Integer>reportdegree();

    @Select("select count(1) from student group by degree ")
    List<Integer> reportcountdegree();

    @Select("select count(1) from student where clazz_id=#{id}")
    Integer countClazzData(Integer id);
}
